package com.zhuss.util;

import org.apache.commons.codec.digest.DigestUtils;

import com.thoughtworks.xstream.core.util.Base64Encoder;

/**
 * 密码操作工具类
 * @author zhushanshuo
 * @Date 2019-10-17 20:30
 *
 */

public class PwdUtil {
	
	public static final String INIT_PWD = "123456";
	
	
	public static String init() {
		return INIT_PWD;
	}
	
	
	public static String md5(String text) {
		String md5 = DigestUtils.md5Hex(text);
		return md5;
	}
	
	public static String encode64(String text) {
		Base64Encoder encoder = new Base64Encoder();
		String code64 = encoder.encode(text.getBytes());
		return code64;
	}
	
	public static String pwd(String pwd) {
		String privatePwd = md5(encode64(pwd));
		return privatePwd;
	}
	
	public static void main(String[] args) {
		System.out.println(md5("zhuss"));
		
		System.out.println(md5("1234!@#$Aa"));
	}

}
